package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.entity.Annex;
import com.project.entity.Change;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * ClassName: ChangeMapper
 * Package: com.project.mapper
 * Description:
 *
 * @Author 看到风
 * @Create 2023/12/28 18:38
 * @Version 1.0
 */
@Mapper
public interface ChangeMapper extends BaseMapper<Change> {
    //更新
    @Update("update `change` set mid=1 where id=#{id}")
    public void changeIF(Long id);

    //获得
    @Select("SELECT mid FROM `change` WHERE id = #{id}")
    public int getChange(Long id);

    //插入
    @Insert("INSERT INTO `change` (id, mid) VALUES (#{id}, #{mid})")
    public void save(Change change);
}
